home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 140
/
Gekkan Dennou Club - 2000.1 Vol. 140 (Japan).7z
/
Gekkan Dennou Club - 2000.1 Vol. 140 (Japan) (Track 1).bin
/
tools
/
dshell
/
dsh333bs.lzh
/
bgputcut.s
next >
Wrap
Text File
|
1999-12-05
|
2KB
|
149 lines
*
* dshell v3
*
* int bgPutCut(CUT *cut, ushort color0, ushort color2);
*
.include doscall.mac
.xdef _bgPutCut
.offset 0
pat: .ds.l 1
fname: .ds.l 1
x: .ds.w 1
y: .ds.w 1
type: .ds.b 1
flag: .ds.b 1
.offset 4
cut: .ds.l 1
.ds.w 1
color: .ds.w 1
*
.text
.even
D equ (1024-768)*2
_bgPutCut:
SAVREGS reg d3-d7/a3-a4
SAVSIZ set (5+2)*4
movem.l SAVREGS,-(sp)
movea.l cut+SAVSIZ(sp),a0
move.w x(a0),d2
move.w #768,d3
sub.w d2,d3
bcs error
move.w color+SAVSIZ(sp),d4
pea.l bgPutCut(pc)
DOS _SUPER_JSR
addq.l #4,sp
moveq.l #0,d0
retn: movem.l (sp)+,SAVREGS
rts
error: moveq.l #-1,d0
bra retn
.offset 0
SIZEofWORK:
*
.text
.even
bgPutCut:
moveq.l #1,d6
swap.w d6
move.w #512-32,d6
move.w y(a0),d7 *>0 を仮定
cmp.w d6,d7
bcs 0f
move.w d6,d7
0: sub.w d7,d6
swap.w d6
subq.w #1,d7
moveq.l #8-1,d0
and.w d2,d0
subq.w #1,d0
move.w d0,a4
lsr.w #3,d2
subq.w #1,d2
moveq.l #8-1,d0
and.w d3,d0
add.w d0,d0
lea.l xDupNext(pc),a3
suba.w d0,a3
lsr.w #3,d3
movea.l pat(a0),a0
lea.l $c00000+(1024*2*16),a1
yLoopS: addq.l #4,a0
yLoop: movea.l a1,a2
move.w d2,d5
bmi 1f
xLoop0: moveq.l #0,d1
move.b (a0)+,d0
bmi 0f
move.w d4,d1
0: move.w d1,(a1)+
.rept 7
moveq.l #0,d1
add.b d0,d0
bmi 0f
move.w d4,d1
0: move.w d1,(a1)+
.endm
xNext0: dbra d5,xLoop0
1: move.w a4,d5
bmi 1f
move.b (a0)+,d0
xLoop1: moveq.l #0,d1
add.b d0,d0
bcs 0f
move.w d4,d1
0: move.w d1,(a1)+
xNext1: dbra d5,xLoop1
1: move.w d3,d5
jmp (a3)
xDupLoop:
.rept 8
move.w (a2)+,(a1)+
.endm
xDupNext: dbra d5,xDupLoop
lea.l D(a1),a1
rol.w #1,d6
dbcs d7,yLoop
dbcc d7,yLoopS
lea.l $c00000+(1024*2*16),a2
swap.w d6
bra hDupNext
TEMPREGS reg d0-d5/a0/a3
hDupLoop0: moveq.l #6-1,d7
hDupLoop1: movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,0*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,1*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,2*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,3*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,4*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,5*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,6*32(a1)
movem.l (a2)+,TEMPREGS
movem.l TEMPREGS,7*32(a1)
lea.l 8*32(a1),a1
dbra d7,hDupLoop1
lea.l D(a2),a2
lea.l D(a1),a1
hDupNext: dbra d6,hDupLoop0
rts
.end